// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import App from './App'
import goods from './components/goods-wrap/splb'
import ratings from './components/ratings-wrap/pj'
import seller from './components/seller-wrap/dp'

Vue.use(VueRouter);
Vue.use(VueResource);

Vue.config.productionTip = false

//定义路由
const routes = [
	{path:'/goods-wrap',component:goods},
	{path:'/ratings-wrap',component:ratings},
	{path:'/seller-wrap',component:seller}
]

//创建router实例,然后传routes配置
const router = new VueRouter({
//	mode:'history',
	routes:routes,
	linkActiveClass:'active'//配置链接激活时的类名
})

//创建和挂载根实例
new Vue({
	el:'#app',
  	template: '<App/>',
	router,
  	components: {     
  		App 
 	}
})

//默认加载某个组件
router.push('goods-wrap')
